import React, { Component } from 'react';
import {HashRouter as Router, StaticRouter,Route,Switch,Redirect} from 'react-router-dom';

import Views from '../';

const Routes = (<Switch>
        <Route exact path="/" component={Views.BeforePage} />
        <Route path="/login" component={Views.Login} />
        <Route path="/manage" component={Views.Books} />
        <Redirect to="/manage" />
      </Switch>);
function ServerRouter(props) {
  return <StaticRouter location={props.url} context={{}}>{ Routes }</StaticRouter>
}

export default function() {
  return <Router>{ Routes }</Router>;
};

export { ServerRouter }